<template>
  <div>
    <TopBar title="我的收藏"></TopBar>
    <div class="books">
      <Collect v-for="item in book_info" :key="item" :title="item.g_name" :img_path="item.img" :author="item.price"
             :intro="item.burdening" :id="item.id"></Collect>
    </div>
  </div>
</template>

<script>
import TopBar from "@/components/TopBar";
import Collect from "@/components/Collect";

export default {
  name: "CateListView.vue",
  components: {
    TopBar,
    Collect,
  },
  data() {
    return {
      id: this.$route.query.id,
      book_list: [],
      cate_name: "",
      book_info:[],
    }
  },
  mounted() {
    this.getData()
  },
  methods: {
    getData() {
      this.$axios.get("customer/collect/",{
            headers:{
          'Authorization':localStorage.getItem('token') || ''
        }
        }).then(res => {
          if (res.data.code == 200) {
            this.book_info = res.data.data
            console.log('>>>>>>>>',res.data.data)
          }
        })
    }
  }
}
</script>

<style scoped>
.books {
  padding: 0 10px;
}
</style>